package auto;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 原生Servlet中使用@WebServlet注册Servlet
 * @author libra
 */
//@WebServlet(urlPatterns= {"hello,helloworld"})
@WebServlet(urlPatterns= {"/hello","/helloworld"})
//@WebInitParam()：进行paramInit初始化
//@WebFilter：注册Filter
//@WebListener：注册Listener
public class HelloServlet extends HttpServlet {

	/**  */
	private static final long serialVersionUID = 4023442997406361930L;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		resp.getWriter().write("hello world...");
	}
}